package com.app.micaihu.view.search.adapter;


import androidx.annotation.NonNull;

import com.app.micaihu.R;
import com.app.micaihu.bean.game.GameCenterEntity;
import com.app.micaihu.configure.UmEventId;
import com.app.micaihu.custom.components.downandupload.LoadingView;
import com.app.micaihu.custom.view.CustomImageView;
import com.app.micaihu.utils.MobclickAgentUtils;
import com.app.utils.util.image.LoadImageUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.facebook.drawee.generic.RoundingParams;

public class SearchRankAdapter extends BaseQuickAdapter<GameCenterEntity, BaseViewHolder> {

    public SearchRankAdapter() {
        super(R.layout.search_rank_item);
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, GameCenterEntity item) {
        MobclickAgentUtils.event(UmEventId.game_exposed, UmEventId.INSTANCE.getSearchbox());

        CustomImageView headView = helper.getView(R.id.game_logo);
        headView.getHierarchy().setRoundingParams(new RoundingParams().setCornersRadius(28.0f));
        LoadImageUtils.getInstance().loadImage(headView, item.getAppIcon());

        LoadingView loadingView = helper.getView(R.id.game_download);
        loadingView.setTag(item);
        loadingView.setEventData(UmEventId.INSTANCE.getSearchbox());

        helper.setText(R.id.tvTitle, item.getArticleTitle());
//        ImageLoadUtils.loadCornersImage();
    }
}
